class Solution:
    def merge(self, nums1, m, nums2, n):
        """
        :type nums1: List[int]
        :type m: int
        :type nums2: List[int]
        :type n: int
        :rtype: void Do not return anything, modify nums1 in-place instead.
        """
        for i in range(len(nums1) - m):
            nums1.pop()

        if m == 0:
            for v in nums2:
                nums1.append(v)
            return
        if n == 0:
            return

        idx_1 = 0
        idx_2 = 0

        while idx_1 <= len(nums1) - 1:
            curr_2 = nums2[idx_2]
            if nums1[idx_1] >= curr_2:
                nums1.insert(idx_1, curr_2)
                idx_2 += 1

            if idx_2 > n - 1:
                break

            idx_1 += 1

        nums1.extend(nums2[idx_2:])

s = Solution()
print('ss', s.merge([4,5,6,0,0,0], 3, [1,2,3], 3))
print('ss', s.merge([0], 0, [1], 1))
print('ss', s.merge([2,0], 1, [1], 1))
print('ss', s.merge([], 0, [2, 5, 6], 3))
print('ss', s.merge([1, 2, 3], 3, [], 0))
print('ss', s.merge([1, 2, 3], 3, [2, 5, 6], 3))
